﻿namespace Huasky.Gm.Application.FaultHandle.Dtos;

public class Mapper : IRegister
{
    public void Register(TypeAdapterConfig config)
    {
        config.ForType<FaultRecord, FaultRecordDto>()
            .Map(dest => dest.Info, src => src.ExtJson.ToObject<FaultRecordInfo>());
        config.ForType<FaultRecordDto, FaultRecord>()
            .Map(dest => dest.ExtJson, src => src.Info.ToJson());
    }
}
